#include <iostream>

// C++11后置返回类型
template<class T, class C>
auto gt(T a,C b) -> double {
    return a + b + 1;
}

template<class T, class C>
auto gt2(T a,C b) -> decltype(a + b) {
    return a + b;
}

template<class T,class B>
void ft(T x,B y){
    // decltype C++11
    decltype(x + y) pxy = x + y;
    std::cout << pxy << std::endl;
}

int main(){
    int a = 3;
    double b = 4.9;
    auto c = gt2(1.1,2.2);
    std::cout << gt(a,b) << std::endl;
    std::cout << c << std::endl;
    ft(3, 4);
    return 0;
}